#pragma once

#ifndef __IASSISTGEN2_SPEECH_ERROR_H
#define __IASSISTGEN2_SPEECH_ERROR_H

#include <string>
#include "CommonUtil.h"

typedef enum {
	SR_ERROR_NOT_RECOGNIZED,
	SR_ERROR_ENGINE_NOT_START,
	SR_ERROR_ENGINE_EXCEPTION_PROC_EVENT,
	SR_ERROR_RECORD_DEVICE_FAIL_TO_CREATE,
	SR_ERROR_RECORD_DEVICE_FAIL_TO_START,
	SR_ERROR_AUDIOSTREAM_FAIL_TO_START,
	SR_ERROR_AUDIOSTREAM_FAIL_TO_GETFRAME,
	SR_ERROR_AUDIOSTREAM_FAIL_TO_SUPPLYDATA,
	SR_ERROR_AUDIOSIGNAL_EXCEPTION_BADSNR,
	SR_ERROR_AUDIOSIGNAL_EXCEPTION_OVERLOAD,
	SR_ERROR_AUDIOSIGNAL_EXCEPTION_TOOQUIET,
	SR_ERROR_AUDIOSIGNAL_EXCEPTION_NOSIGNAL,
	SR_ERROR_AUDIOSIGNAL_EXCEPTION_POORMIC,
	SR_ERROR_AUDIOSIGNAL_EXCEPTION_NOLEADINGSILENCE,
	SR_ERROR_UNKNOWN,
	SR_SUCCESS
} SRError;

static const char* SRErrorCode[] = {
	"SR_ERROR_NOT_RECOGNIZED",
	"SR_ERROR_ENGINE_NOT_START",
	"SR_ERROR_ENGINE_EXCEPTION_PROC_EVENT",
	"SR_ERROR_RECORD_DEVICE_FAIL_TO_CREATE",
	"SR_ERROR_RECORD_DEVICE_FAIL_TO_START",
	"SR_ERROR_AUDIOSTREAM_FAIL_TO_START",
	"SR_ERROR_AUDIOSTREAM_FAIL_TO_GETFRAME",
	"SR_ERROR_AUDIOSTREAM_FAIL_TO_SUPPLYDATA",
	"SR_ERROR_AUDIOSIGNAL_EXCEPTION_BADSNR",
	"SR_ERROR_AUDIOSIGNAL_EXCEPTION_OVERLOAD",
	"SR_ERROR_AUDIOSIGNAL_EXCEPTION_TOOQUIET",
	"SR_ERROR_AUDIOSIGNAL_EXCEPTION_NOSIGNAL",
	"SR_ERROR_AUDIOSIGNAL_EXCEPTION_POORMIC",
	"SR_ERROR_AUDIOSIGNAL_EXCEPTION_NOLEADINGSILENCE",
	"SR_ERROR_UNKNOWN",
	"SR_SUCCESS"
};

static const char* SRErrorDesc[] = {
	"Not recognized",
	"SR engine not started",
	"SR engine error: event processing exception",
	"SR recording error: device cannot be created",
	"SR recording error: device cannot start",
	"SR recording error: stream cannot start",
	"SR recording error: cannot get frame",
	"SR recording error: cannot process frame",
	"SR signal exception: too noisy",
	"SR signal exception: too loud",
	"SR signal exception: too quiet",
	"SR signal exception: no signal detected",
	"SR signal exception: poor mic",
	"SR signal exception: speak before PTT",
	"Unknown SR error",
	"SR Success"
};

static const std::string getSRErrorCode(SRError type) {
	return SRErrorCode[type];
}

static const std::string getSRErrorDesc(SRError type) {
	return SRErrorDesc[type];
}

typedef enum {
	TTS_ERROR_ENGINE_NOT_START,
	TTS_ERROR_UNKNOWN
} TTSError;

static const char* TTSErrorCode[] = {
	"TTS_ERROR_ENGINE_NOT_START",
	"TTS_ERROR_UNKNOWN"
};

static const char* TTSErrorDesc[] = {
	"TTS engine not started",
	"Unknown TTS error"
};

static const std::string getTTSErrorCode(TTSError type) {
	return TTSErrorCode[type];
}

static const std::string getTTSErrorDesc(TTSError type) {
	return TTSErrorDesc[type];
}
#endif
